using System;
using System.Windows.Forms;
using Microsoft.WowAddonStudio.Lua.RuntimeService.ShellHost;

namespace Microsoft.WowAddonStudio.Lua.RuntimeService.WowBench
{
	/// <summary>
	/// WoWBenchController definition.
	/// </summary>
	public interface IWoWBenchController : IWoWBenchCommandHandler, IDisposable
	{
		/// <summary>
		/// Gets the current WoWBenchCommand.
		/// </summary>
		ICommandEntry WowBenchCommand { get; }

		/// <summary>
		/// Gets the current text buffer position.
		/// </summary>
		int BufferPosition { get; }

		/// <summary>
		/// Initializes the controller object.
		/// </summary>
		/// <param name="textBox">The display control for OutputWriter.</param>
		void Initialize(TextBoxBase textBox);

		/// <summary>
		/// Run WoWBench in shell process and loads current AddOn.
		/// </summary>
		/// <returns>True if shell process started successfully, otherwise false.</returns>
		bool RunWoWBenchAddOn();

		/// <summary>
		/// Run WoWBench in shell process.
		/// </summary>
		/// <returns>True if shell process started successfully, otherwise false.</returns>
		bool RunWoWBench();

		/// <summary>
		/// Run Lua prompt in shell process.
		/// </summary>
		/// <returns>True if shell process started successfully, otherwise false.</returns>
		bool RunLuaInterpreter();

		/// <summary>
		/// Gets the IOutputWriter implementation.
		/// </summary>
		IOutputWriter TextOutputWriter { get; }

		/// <summary>
		/// Writes the gives message to the output.
		/// </summary>
		/// <param name="message">The desired message.</param>
		/// <param name="error">If true then write message as error.</param>
		void SendMessage(string message, bool error);


		/// <summary>
		/// Gets the IShellHost for current Runtime.
		/// </summary>
		IShellHost RuntimeShellHost { get; }

		/// <summary>
		/// CommandHistory for WoWBench window.
		/// </summary>
		ICommandHistory CommandHistory { get; }

		/// <summary>
		/// Resets the controller state.
		/// </summary>
		void Reset();
	}
}